package org.ztr.yanai.blog.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.ztr.yanai.blog.enums.PostStatusEnum;

import java.time.LocalDateTime;

/**
 * @Author: ZhaoTR
 * @Date: Created in 2025/11/22 10:00
 * @Description: 文章实体类
 * @Version: 1.0
 */
// 文章
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("post")
public class Post {
    @TableId(type = IdType.AUTO)
    private Long id;

    private String title;
    private String content;

    @TableField("user_id")
    private Long userId;

    private PostStatusEnum status;

    private Integer views;
    private Integer likes;

    @TableField("created_at")
    private LocalDateTime createdAt;

    @TableField("updated_at")
    private LocalDateTime updatedAt;

    @TableLogic
    @TableField("is_deleted")
    private Boolean isDeleted;
}